/*
  Copyright 1996-2003
  Simon Whiteside

*/
package simkin.examples.inherits;
import simkin.*;
import java.io.*;
import org.apache.crimson.tree.*;
import org.xml.sax.*;
import org.w3c.dom.*;
import java.util.*;

/**
 * This class loads an XML file and makes sure any &lt;inherits&gt; tags are resolved.
 */
public class InheritsExecutable extends InheritsElement {
    /**
     * This is the XML document loaded for this object
     */
    XmlDocument m_Doc;
    /**
     * Constructor taking an input stream containing an XML document
     * @throws SAXException where there was a syntax error in the XML stream
     * @throws IOException where there was an error loading the stream
     */
    public InheritsExecutable(String location,InputStream in) throws SAXException, IOException {
	super(location,null);
	load(in);
    }
    /**
     * This method is overriden to search for the inherits tag
     * @param in - stream containing the XML
     */
    public void load(InputStream in) throws SAXException, IOException{
	m_Doc=XmlDocument.createXmlDocument(new InputSource(in),false);
	setElement(m_Doc.getDocumentElement());
    }
}
